home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hottest 6
/
Hottest 6 (1996)(PDSoft)[!].iso
/
software
/
fredfish
/
1100.lha
/
Programs
/
Sort
/
sort.doc
< prev
next >
Wrap
Text File
|
1995-04-12
|
6KB
|
146 lines
sort.doc sort Version 1.36 by Rüdiger Werner
The program and files in this distribution are freely distributable,
but are also copyright (c) Rüdiger Werner. They may be freely
distributed as long as no more than a nominal fee is charged to cover
time and copying costs.
No commercial usage is permitted without written permission from the
author. Everything in this distribution must be kept together, in original
unmodified form.
This program is cardware, that means if you find this program useable or
if you tried it then I'd like to receive a postcard from you.
Of course I'd be very grateful, if you want to donate the author.
The money will be used for a good purpose: I know very well a small indian
boy who needs to be operated quite urgent. The parent have to pay the
operation themselves, but they can't afford it. This is true, really.
***********************************************************************
* Notice that the author can't be made responsible for the destroying *
* or lost of data through use of this program. You use it on your own *
* risc. Please read the Doc-file before using. *
***********************************************************************
Please contact me if you have any comments or suggestions
or if you simply tried the program:
E-Mail: rw2@irz.inf.tu-dresden.de
wernerr@eeetwc.et.tu-dresden.de
Mail: Rüdiger Werner
Stresemannplatz 2
01309 Dresden
GERMANY
CHANGES TO LAST VERSION
the -s option now works also in a given range only
Description
-----------
The program was written for use in Shell only.
It is started either by simply typing it's name (of course it should be
in the current directory or in the path) or by giving additionally switches
and/or the name of the file what should be sorted.
sort [switches] infile [infile 2 ... ] [outfile]
By typing 'sort ?' appears a short help.
The specified file is opened and red in the memory. There it will be sorted
and, if the switches were set, manipulated in the required way.
Switches:
-a sorting the file in ascending order (it is optional, because default)
-d sorting the file in descending order
-e all lines which are empty will be erased.
-E after sorting all lines which are empty or more than once in a file
will be erased (of course ONE of these lines is kept in the file).
-f[y] using this option one can specify the first line of a range to be
sorted. if this option is given, ALL actions are done ONLY within
this range. to give also the last line is not compelling
if y is bigger than the number of lines of the internal file
(all in-read files together) an error-message appears and the
program is cancelled
-g actually the capitals and small letters are distinguished.
by setting this switch, they won't be distinguished.
-j[x] joins x files and sort them, after that the resulting file will be
written to <outfile>
-J[x] joins x files but they won't be sorted; the resulting file will be
written to <outfile>
-l[y] using this option one can specify the last line of a range to be
sorted. if this option is given, ALL actions are done ONLY within
this range. to give also the first line is not compelling
if y is bigger than the number of lines of the internal file
(all in-read files together) the last line is automatically taken
as last line of the range
if x or/and y is not given it will be asked for
-n the file is not sorted, only empty lines are erased.
-N the file is not sorted, only empty lines and lines with the same
contents which are side by side are erased (of course ONE line is
kept in the file).
Note that it might more useful if the file is sorted.
-o the specified file for reading will be overwritten by the sorted
file. DANGER!!! If once overwritten the original file can't be
restored!!!
-p all lines, which doesn't match the search pattern will be removed
the given string may be shorter than the lines, only the length of
the string will be compared
-P all lines, which match the search pattern will be removed
see -p
-r the file which was red will only be written in reverse order of lines
-s[c] with this option the character c will be removed from the file.
note: if characters like " need to be removed it is advisable to give this
switch as the very last of the command line. Reason is that the following
arguments are not recognized after a " by the programm.
-x the sorting function will be disabled
The switches can be set at any place after the program name.
If the parameter to the switch is not given, it will be asked for.
The program detects contradictions between given switches to avoid possible
mistakes from the user
Notice that the outfilename has to be the last of all filenames.
If no outfilename is given, the first infilename plus a new ending is used
for a suggestion for the outfilename.
The maximum length of a line in a file is 1024 byte.
All bytes that a line is longer than this are cutted. A message appears in
this case. If you need to sort longer lines, just send me a mail.
The size of the file to be sorted depends only on the size of the available
memory (and on your patience). The used time is shown after sorting, just
for your statistics ...
I have tested the programm with hundreds of different files and no loss
of data appeared.
I'd be grateful for any comments, suggestions and bug reports.
Well, that's all I can tell about it.
planned is to add a feature that one can sort the lines after the 10th or
13th or whatever char, not only after the first
Hope that you can use the program.
Rüdiger Werner